package com.hulk.dryad.manage.provider.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hulk.dryad.common.component.R;
import com.hulk.dryad.common.constant.CacheConstants;

import com.hulk.dryad.persistence.entity.DictCode;
import com.hulk.dryad.persistence.entity.DictType;
import com.hulk.dryad.persistence.entity.enums.DictTypeEnum;
import com.hulk.dryad.persistence.mapper.DictCodeMapper;
import com.hulk.dryad.persistence.mapper.DictTypeMapper;
import com.hulk.dryad.manage.provider.service.DictTypeService;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author hulk
 * @since 2019-05-16
 */
@RequiredArgsConstructor
@Service
public class DictTypeServiceImpl extends ServiceImpl<DictTypeMapper, DictType> implements DictTypeService {


	@Override
	public DictType getByType(String dictType){
		if (StringUtils.isBlank(dictType)){
			return null;
		}
		return this.getOne(Wrappers.<DictType>lambdaQuery().eq(DictType::getDictType, dictType));
	}


}
